/**
 * \file CAuthentificationRequestData.h
 * \author Corentin Le Bail
 * \date 2009-2013
 * \brief Fichier de déclaration de la classe CAuthentificationRequestData
 */
//------------------------------------------------------------------------------
#ifndef __CAUTHENTIFICATIONREQUESTDATA_H__
#define __CAUTHENTIFICATIONREQUESTDATA_H__
//------------------------------------------------------------------------------
#include <QObject>
#include <QCryptographicHash>
#include "CBaseRequestData.h"
#include "CGlobal.h"
//------------------------------------------------------------------------------
class CAuthentificationRequestData : public CBaseRequestData {
	Q_OBJECT
	Q_PROPERTY(QString userName READ getUserName)
	Q_PROPERTY(QString passWord READ getHashPassWord)
	public:
		void setUserName(QString userName) { this->userName=userName; }
		QString getUserName(void) { return userName; }
		void setPassWord(QString passWord) { this->passWord=passWord; }
		QString getPassWord(void) { return passWord; }
		QString getHashPassWord(void) { return QCryptographicHash::hash((SALT+"_"+passWord).toUtf8(),QCryptographicHash::Md5).toHex(); }
		QString getKey(void) { return userName+getHashPassWord(); }
	private:
		QString userName;
		QString passWord;
};
//------------------------------------------------------------------------------
#endif// __CAUTHENTIFICATIONREQUESTDATA_H__
//------------------------------------------------------------------------------